package features.advance.jdk.design;

import java.util.Observer;

/**
 * @author LIN
 * @date 2021-08-19
 */
public class Main {

    public static void main(String[] args) {
        ConcreteObservable observableDemo = new ConcreteObservable();
        Observer concreteObserver = new ConcreteObserver();
        Observer concreteObserver1 = new ConcreteObserver();
        Observer concreteObserver2 = new ConcreteObserver();
        Observer concreteObserver3 = new ConcreteObserver();
        observableDemo.addObserver(concreteObserver);
        observableDemo.addObserver(concreteObserver1);
        observableDemo.addObserver(concreteObserver2);
        observableDemo.addObserver(concreteObserver3);
        int i = observableDemo.countObservers();
        System.out.println(i);
        observableDemo.addNewValue("a");

    }


}
